{template 'common/header'}
<link rel="stylesheet" href="../addons/kuyuan_fm/dist/web/common.css" />
<link rel="stylesheet" href="../addons/kuyuan_fm/dist/web/plugin.css" />
<div id="louie" data-url="{php echo $this->createWebUrl('api')}">

    <!--S头部-->
    <div id="header">
        <h2><i class="iconfont icon-chajian"></i> 插件列表</h2>
        <button type="button" class="update-plugin-btn btn btn-info btn-sm" @click="updatePlugin">更新插件</button>
    </div>
    <!--E头部-->

    <!--S插件列表-->
    <table class="table table-hover">
        <tr>
            <th>插件名称</th>
            <th>简介</th>
            <th>是否收费</th>
            <th>是否安装</th>
            <th>管理</th>
        </tr>
        <tr v-for="(item,index) in list" :key="index">
            <td>{{item.name}}</td>
            <td>{{item.brief}}</td>
            <td>
                <button class="btn btn-info btn-xs" v-if="item.charge === 1">收费</button>
                <button class="btn btn-success btn-xs" v-else>免费</button>
            </td>
            <td>
                <button class="btn btn-info btn-xs" v-if="item.install === 1">已安装</button>
                <template v-else>
                    <button class="btn btn-danger btn-xs">未安装</button>
                    <a class="go-install" :href="item.install_url" target="_blank">点击安装</a>
                </template>
            </td>
            <td>
                <button class="btn btn-info btn-success btn-xs" v-if="item.install === 1" @click="setPlugin(index)">设置</button>
                <button class="btn btn-info btn-success btn-xs" v-else :disabled="true">设置</button>
            </td>
        </tr>
    </table>
    <!--E插件列表-->

    <!--显示插件组件-->
    <modal
            class="plugin-box"
            name="plugin-box"
            :adaptive="true"
            :click-to-close="false"
            width="80%"
            :height="650"
            v-if="list[index]"
    >
        <h2>{{list[index].name}}<div class="close-plugin" @click="$modal.hide('plugin-box')"><i class="iconfont icon-guanbi"></i></div></h2>

        <div class="box">
            <plugin-address :api="list[index].api" v-if="list[index].value === 'address'"></plugin-address>
            <plugin-auto :api="list[index].api" v-if="list[index].value === 'auto'"></plugin-auto>
        </div>

    </modal>
    <!--显示插件组件-->

    <!--提示框--><v-dialog style="z-index:99999999;"/>
</div>
<script src="../addons/kuyuan_fm/dist/web/common.js"></script>
<script src="../addons/kuyuan_fm/dist/web/plugin.js"></script>
{template 'common/footer'}